<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>欢迎页面</title>
		<script src="../js/jq3.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/mui.js"></script>
		<link href="../css/mui.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="../css/common.css" />
		<script type="text/javascript" src="../js/dbManager.js"></script>
		<style type="text/css">
			body {
				padding-top: 4px;
			}

			.mui-slider-item img {
				height: 16rem;
				width: auto;
			}

			.mui-slider-item .detail {
				position: absolute;
				bottom: 0px;
				width: 100%;
				height: 45px;
				background-color: lightseagreen;
				opacity: 0.9;
				text-align: center;
				background-image: linear-gradient(rgba(0, 255, 255, 0.8), rgba(123, 213, 98, 1));
			}
		</style>
	</head>
	<body>

		
		<div class="mui-slider">
		  <div class="mui-slider-group" id="轮播图特跌">
		    
		   
		  </div>
		</div>
		
	</body>
</html>
<script type="text/javascript">
	// 进入app的第一个视窗 - 登陆或者校验权限
	// var gallery = mui('.mui-slider');
	// gallery.slider({
	// 	interval: 2500 //自动轮播周期，若为0则不自动播放，默认为0；
	// });

	var _path_doc =  "/storage/emulated/0/Android/data/io.dcloud.HBuilder/apps/HBuilder/doc/"
	document.addEventListener('plusready', function() {
		// 初始化轮播图内容
		initSlider();
		_path_doc = plus.storage.getItem("path_doc");
		
	}, false);


	

	function initSlider() {
		DBmanager.openDb();
		plus.sqlite.selectSql({
			name: DBmanager.name,
			sql: "select * from  trips order by id limit 10",
			success: function(res) {
				
				$("#轮播图特跌").empty();
				top10 = res;
				for (let i = 0; i < top10.length; i++) {
					// console.info(JSON.stringify(top10[i] ));
					var template = `
						 <div class="mui-slider-item"><a href="#"><img src="${_path_doc}cameraxxx/${top10[i].pic}" /></a></div>
					`;
					$("#轮播图特跌").append(template);

				}
				var gallery = mui('.mui-slider');
				gallery.slider({
				  interval:5000//自动轮播周期，若为0则不自动播放，默认为0；
				});


			},
			fail: function(err) {
				console.info(err.message)
			}
		});
	}



</script>
